var fs = require('fs');
var zlib = require('zlib');
// 压缩文件
fs.createReadStream('./stream.txt')
    .pipe(zlib.createGzip())
    .pipe(fs.createWriteStream('input.txt.gz'));
console.log('文件压缩成功！');


// fs.createReadStream('./input.txt.gz')
// .pipe(zlib.createGunzip())
// .pipe(fs.createWriteStream('input.txt'));
// console.log('文件解压成功！');